APC Action Applications - Home Page

Frequently Asked Questions v2

 

Topic: Slice Configuration

0. How to import big exported slice&data?
1. What are the 'Action Aplication Core' and 'News (EN) Template' slices?
2. How can I modify the fonts used in the AA interface?
3. How are mutual related links propogated?
4. Is there a way to allow different users to log in to the same slice but with their own language choice?
5. MultiLingual eXtension for ActionApps / How to setup ActionApps for multilingual web sites

We have slice data and structure exported to AA.XML file and we want to import it back to the AA. The problem is, that the AA.XML file is 24 MB.

The solution:

The problem could be in PHP setting. Here's what I had to change in php.ini file to get it going:

1. post_max_size: increased from 8M to 32M
2. upload_max_filesize: increased from 2M to 32M

Those first two were key -- from the php log the upload was clearly exceeding both of these parameters. Obviously, if the upload was bigger than 32M (ours was about 24M) this might need to go even bigger.

I also increased these others. I think the upload wouldn't have completed in the default times, but I'm not sure which parts of the operation count towards which of these:

1. max_execution_time: changed from 30 to 120 seconds
2. max_input_time: changed from 30 to 120 seconds
3. memory_limit: changed to 32M There are two (and should be more in the future) odd slices in slice listbox. Why?

Both - the 'Action Aplication Core' and 'News (EN) Template' are only visible to superadmins and both should not have any items.

News (EN) Template

The 'News (EN) Template' slice is just a template for creating new slices. This template is shown as an option in "Admin" -> "Add Slice" dialog in templates listbox. If you feel a setting for the new created slices is not optimal you have two possibilities:

Action Aplication Core

'Action Aplication Core' slice is something another. In this slice there are defined the default values for each field type. These values are used when you add some new field to a slice on the "Admin" -> "Main settins - Field" page. Fill the field name, priority and field type. After you have clicked on update, the new field is added to the database for the slice and the values (like validate function, alias, help text, ...) are copied from the same field in the 'Action Aplication Core' slice. It is a good idea to translate the help texts in the 'Action Aplication Core' slice too when you are translating the whole ActionApps to some other language.

There are CSS files in the root directory that you can modify or create a new CSS file and point to it from include/config.php3 (line 139). When you update an item that includes a mutual related link it will update the matching relation field ID in the related slice. Make sure both slices are using the exact same ID and that the input Insert is set to "Item IDs".

No, it is not possible - at least yet.

 There is a problem with characters encoding and different languages. Each language uses its own character encoding (like iso-8859-1 for English and Spanish, iso-8859-2 or windows-1250 for Czech, ...). If you select language for the slice, you also select (implicitly) the character encoding. If we allow users to use different language in the same slice, each item will be in different encoding, ... which means problems.

MLX - MultiLingual eXtension for APC-ActionApps

 

MLX adds content translation and interface translation features to ActionApps. All of this is now part of ActionApps core and these pages are here mainly for documentation and historic reasons.

(or mimo's language extension)

(C) Michael Moritz mimo/at/restoel.net
MLX Screenshots

Changelog

  • 05/11/2004 MLXGet Text Documentation
  • for changelog see APC AA CVS on SourceForge
  • 05/10/2004 -- changed the way ids get stored, optimised sql queries and since MLX is now in APC-AA CVS removed the installation stuff from this page, to upgrade without CVS have a look at MLX installation -- the hard way
  • 04/10/2004 -- now moved into APC AA CVS on SourceForge
  • 03/10/2004 -- apc-aa-mlx-0.2: support for simple slice.php3 calls; better admin integration (using MLX tabs)
  • 29/09/2004 -- first buggy release: basic admin interface functions

Step-by-Step Example of setting up a slice for MLX

  1. Create a new slice based on News Template and call it MLX Control Slice.
  2. Delete all deleteable fields from this slice.
  3. Add two new fields. Call one EN, the other one FR and choose type MLX Control for them.
  4. Unshow all other fields apart from these two. Have a look at MLX Screenshots to see what this should look like.
  5. Create a new slice. This one will hold the actual content (Content Slice). It can be any kind of slice.
  6. In Slice Settings select the MLX Control Slice you created before. Again, MLX Screenshots are your friend.
  7. Check that the slice contains a lang_code....... field.
  8. Add a field for the MLX information. It must be of type MLX Control. It doesnt have to be visible, so in most cases you want to hide it from the user by unticking Show.
  9. Done! You are ready to use the multilingual content slice.

 

Using MLX

MLX adds a little menu to the Add Item / Edit Item pages. This contains something like:

Add German | Edit English (view) | Edit Dari | etc.

Clicking on Add DE takes you to the Add Item page. This is prefilled with the contents of the original item. Once you have translated this content press the Insert button. MLX takes care of storing the information that keeps the original version of the article and the German translation together.
 

MLX and slice.php3 -- Displaying content using MLX on a web site

From version 0.2 MLX does actually do something do the output as well. This is configurable depending on what situation you are in. Here are three scenarios:

  1. You have a multilingual site. Some articles are translated, others only exist in the original language. If a vistor to your site chooses a language into which only some articles are translated you want to display the untranslated ones nevertheless (an example of this is the ESF2004 website). In this case you would use slice.php3 like this: add mlx=FR to the URL if the user selected French as his/her language. E.g. index.shtml?mlx=FR&listlen=10. MLX takes care of showing translations or original items for you. It will display an alternarive article (in this example a non-French one) if it exists one. If more than one other translation exists MLX uses the order in which the languages are defined in the MLX Control Slice. So the step-by-step example above would first look for an English version. But you (or the user may chose to) can even override this behaviour: The same way you pass the user's language choice to slice.php3 you can aslo set the order in which alternatives are used. With two languages this doesnt make sense, but given you had a third translation, let's say in German, you could pass the order like this: index.shtml?mlx=FR-DE-FR This would make MLX first look for a French version of the item, then a German one, and then a French one and display the first one found.
  2. You only want to display articles in the language the user has chosen. Use this syntax for your calls to slice.php3: index.shtml?mlx=FR-ONLY (This is similiar to using a condition)
  3. You want to display all articles including other language versions. Syntax: index.shtml?mlx=ALL. (This ignores MLX information)

MLX and view.php3

MLX supports views as well. Use set[vid]=mlx-(lang code)-(lang code 1)-..-(mode)

The _#MLX_LANG Alias

When using language defaulting this is helpful. It allows to print the current desired or default language in a view. This is hopefully helpful for creating language menus, displaying messages like "currently there isnt a translation for this article, so the original version is displayed". Have a look at the demo in MLX Screenshots for how this works.

FAQ

  1. Q: How do I MLX-alise a slice?
    A: Follow the steps in the Step-by-Step example but skip creating the Content Slice (step 5). Make sure you set the MLX Control Slice as the MLX: Language Control Slice in the slice you want to MLX-alise and that you have a field of type lang_code....... in it. To MLX-alise an item you need to edit it in the Item Manager. This means you click on the headline and the press the Update button. Click on the headline again and MLX is ready.

Bugs & Limitations & TODOS

  • Maybe add to fulltext view also in slice.php3
  • Testing, testing, testing

Credits

  • Huge thanks to Marek Tichy for discussing this and helping implementing it as I did not know anything about Action Apps? code when I started
 

(was on http://mimo.gn.apc.org/mlx)

 

This FAQ interface was developed by Jason at Commons.ca

APC: Internet and ICTs for social justice and development APC ActionApps is a free software content management system initiated by the Association for Progressive Communications (APC)
APC - Internet and ICTs for social justice and development